package com.amos.isearch.common.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * DESCRIPTION: 文件工具类
 *
 * @author <a href="mailto:daoyuan0626@gmail.com">amos.wang</a>
 * @date 2021/1/23
 */
public class FileUtils {

    public static String getContent(File file) {
        try {
            return new String(new FileInputStream(file).readAllBytes(), StandardCharsets.UTF_8);
        } catch (IOException e) {
            e.printStackTrace();
        }

        return null;
    }

}
